<include file="Public/header" />
<body onselectstart="return false">
<style>
    .pop-imgshow{position:fixed;top:0;left:0;right:0;bottom:0;background: rgba(0,0,0,0.7);text-align: center;}
    .pop-imgshow span{display:inline-block;height:100%;vertical-align: middle;}
    .pop-imgshow img{max-width:80%;max-height:80%;vertical-align: middle;}
</style>
<div class="main">
    <div class="content">
        <div class="head-content">
            <div class="head-title">取件复核</div>
            <div class="head-search">
            </div>
        </div>
    </div>
    <div class="content">
        <div class="head-content">
            <form action="<{:U('review')}>" method='get'>
                <div class="head-search">			
                    <input class="form-input-small" type="text" value="<{:I('get.no')}>" name='no' placeholder="编号" />
                    <input class="form-input-small" type="text" value="<{:I('get.phone')}>" name='phone' placeholder="手机号" />
                    <input class="form-input-small" type="text" value="<{:I('get.name')}>" name='name' placeholder="姓名" />
                    <button class="form-button color-bg-green">搜索</button>
                </div>
            </form>
        </div>
    </div>
    <div class="table-list">
        <table cellpadding="0" cellspacing="0">
            <thead>
            <tr>
                <th>快件编号</th>
                <th>货柜编号</th>
                <th>取件人姓名</th>
                <th>取件人号码</th>  
				<th>快递员姓名</th>	
				<th>快递员号码</th>	
                <th>快递员身份证</th>               
				<th>收件人身份证</th>				
                <th>短信 | 语音</th>              
                <th>领取状态</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <foreach name='list' item='vo'>
                <tr >
                    <td><{$vo['no']}></td>
                    <td><{$vo['container']['no']}></td>
                    <td><{$vo['name']}></td>
                    <td><{$vo['phone']}></td>
                    <td><{$vo['courier_name']|default='-'}></td>
                    <td><{$vo['courier_phone']|default='-'}></td>
                        <td>
						<if condition="$vo['card']">
                        <div onclick="imgshow($(this))" style="margin-top:10px;height: 60px;width :60px;background-size: cover;background-repeat: no-repeat;background-position: center;background-image: url('<{$vo['card']}>') ;"> </div>
                            <else />
                            -
                        </if>
					</td>               
					 <td>
						<if condition="$vo['sender_card']">
                        <div onclick="imgshow($(this))" style="margin-top:10px;height: 60px;width :60px;background-size: cover;background-repeat: no-repeat;background-position: center;background-image: url('<{$vo['sender_card']}>') ;"> </div>
                            <else />
                            -
                        </if>
					</td>               
                    <td style="font-style: inherit"><{$vo['mess_status']|get_post_mess_status}> | <{$vo['voice_status']|get_post_voice_status}></td>                   
                    <td style="font-style: inherit"><{$vo['status']|get_post_status}></td>
                    <td><{$vo['create_time']}></td>
                    <td>
                        <div class="operate-list">
                            <button style="float:none" onclick="take_info(<{$vo['id']}>)" class="form-button color-bg-green">取件</button>
                        </div>
                    </td>
                </tr>
            </foreach>
        </table>

        <!--没有结果时显示-->
        <if condition="!$list" >
            <div class="nodata"><i class="iconfont">&#xe607;</i><span>没有查询到符合条件的记录</span></div>
        </if>

        <!--分页效果-->
        <div class="table-foot">
            <div class="foot-page">
                <ul><{$page}></ul>
            </div>
        </div>

    </div>
</div>

<!--提示框-->
<div class="pop-window pop-delete" id="info">
    <input type="hidden" name="id" id="id"   >
    <div class="pop-notice FromUpToDown">
        <div class="notice-head">
            <div class="notice-head-title">温馨提示</div>
            <div class="notice-head-delete">×</div>
        </div>
        <div class="notice-content">
            <div>
                <i class="iconfont">&#xe607;</i>
            </div>
            <div class="notice-content-word">是否要删除本条信息？</div>
        </div>
        <div class="notice-foot">
            <a href="javascript:;" onclick="del()" class="notice-btn btn-submit">确定</a>
            <a href="javascript:;" class="notice-btn btn-drop">取消</a>
        </div>
    </div>
</div>

<!--取件提醒-->
<div class="pop-window pop-delete" id="take">
    <input type="hidden" name="take_id" id="take_id"   >
    <div class="pop-notice FromUpToDown">
        <div class="notice-head">
            <div class="notice-head-title">温馨提示</div>
            <div class="notice-head-delete">×</div>
        </div>
        <div class="notice-content">
            <div>
                <i class="iconfont">&#xe607;</i>
            </div>
            <div class="notice-content-word">确认客户已取件？</div>
        </div>
        <div class="notice-foot">
            <a href="javascript:;" onclick="take()" class="notice-btn btn-submit">确定</a>
            <a href="javascript:;" class="notice-btn btn-drop">取消</a>
        </div>
    </div>
</div>


<include file="Public/footer" />

<script>
    $(function(){
        var phone = $("input[name='phone']").val();
        $("input[name='phone']").focus().val(phone);
    });

    //弹出询问框
    function info(id){
        $("#id").val(id);
        $("#info").show();
    }

    //删除
    function del(){
        $('#info').hide();
        var id = $("#id").val();
        $.get(
                "<{:U('del')}>",
                {
                    id:id
                },
                function(res){
                    if(res.status == false){
                        layer.msg(res.info,{time:1000});
                    }else{
                        layer.msg(res.info,{time:1000});
                        setTimeout("location.reload()",1000);
                    }
                }
        );
    }

    //取件询问
    function take_info(id){
        $("#take_id").val(id);
        $("#take").show();
    }

    function take(){
        $("#take").hide();
        var id = $("#take_id").val();
        $.get(
                "<{:U('take')}>",
                {
                    id:id
                },function(res){
                    if(res.status == 1){
                        layer.msg(res.info,{time:1000});
                    }else{
                        layer.msg(res.info,{time:1000});
                        setTimeout("location.reload()",1000);
                    }
                }

        );
    }

    function imgshow(obj){
        var background = obj.css("background-image");
        var reg = /"(.*)"/;
        var res = reg.exec(background);
        var popImgshow='<div onclick="$(this).remove();" class="pop-imgshow"><span></span><img src="'+res[1]+'"/></div>';
        $('body').append(popImgshow);
    }
</script>

</body>
</html>